#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    int n = 0, m = 0, arr[11][11] = { 0 }, max = 0, x = 0, y = 0;
    scanf("%d %d", &n, &m);
    int i = 0, j = 0;
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < m; j++)
        {
            scanf("%d", &arr[i][j]);
            if (max < arr[i][j])
            {
                max = arr[i][j];
                x = i;
                y = j;
            }
        }
    }
    printf("%d %d\n", x + 1, y + 1);
    return 0;
}